package com.iotechn.unimall.data.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.iotechn.unimall.data.domain.RunningRecordDO;
import com.iotechn.unimall.data.dto.RunningRecordDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created by rize on 2019/7/1.
 */
public interface RunningRecordMapper extends BaseMapper<RunningRecordDO> {

    /**
     * 打卡记录分页查询
     * @param page
     * @param startTime
     * @param endTime
     * @return
     */
    List<RunningRecordDTO> selectPage(Page<RunningRecordDTO> page, @Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("runningGroupId") Long runningGroupId);


    void deleteAllRecord(@Param("runningGroupId") Long runningGroupId);

    void deleteByUserId(@Param("userId") Long userId);

    int deleteByUserIdAndGroupId(@Param("userId") Long userId,@Param("runningGroupId") Long runningGroupId);

}
